package com.leetcode;

import java.util.*;

/**
 * @Description:
 * 复刷使用
 * @Author: Mr.Fxy
 * @CreateTime: 2024-08-14 22:04
 */
public class test {
        public ListNode getIntersectionNode(ListNode headA, ListNode headB) {
            if(headA == null || headB == null) return null;
            ListNode a = headA, b = headB;
            while(a != b){
                a = a == null ? headB : a.next;
                b = b == null ? headA : b.next;
            }
            return headA;
        }
}
